/**
 * 
 */
package com.pmsco.pms.services.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.pmsco.pms.core.dao.PmsRoleDao;
import com.pmsco.pms.core.domain.PmsRole;
import com.pmsco.pms.services.interfaces.PmsRoleService;

/**
 * @author Long Tran
 *
 */
public class PmsRoleServiceImpl implements PmsRoleService {
	private static final Logger logger = LoggerFactory.getLogger(PmsRoleServiceImpl.class);
	
	private static PmsRoleDao pmsRoleDao;
	
	public PmsRole getRole(String role) {
		logger.info("Start getRole");
		logger.debug("Role: " + role);
		PmsRole pmsRole = new PmsRole();
		pmsRole.setRole(role);
		logger.info("End getRole");
		return pmsRoleDao.getRole(pmsRole);
	}

	public PmsRole getRoleById(Long id) {
		return pmsRoleDao.getRoleById(id);
	}

	public List<PmsRole> listPmsRole(PmsRole searchTemplate) {
		return pmsRoleDao.listPmsRole(searchTemplate);
	}

	/**
	 * @param pmsRoleDao the pmsRoleDao to set
	 */
	public void setPmsRoleDao(PmsRoleDao pmsRoleDao) {
		logger.info("Start setPmsRoleDao");
		logger.debug("PMS Role Dao: " + pmsRoleDao);
		this.pmsRoleDao = pmsRoleDao;
		logger.info("End setPmsRoleDao");
	}
	
}
